//
//  HomeMenuCell.m
//  Safflower
//
//  Created by 袁亮 on 2016/11/28.
//  Copyright © 2016年 Migic_Z. All rights reserved.
//

#import "HomeMenuCell.h"

@interface HomeMenuCell()

@property (nonatomic, strong) UIImageView *menu_image_view;

@property (nonatomic, strong) UILabel *title_label;

@end

@implementation HomeMenuCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        _title_label = [UILabel new];
        _title_label.textColor = RGB(0, 0, 0);
        _title_label.font = [UIFont systemFontOfSize:17.0f];
        _title_label.textAlignment = NSTextAlignmentCenter;
        [self.contentView addSubview:_title_label];
        [_title_label mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.mas_equalTo(-10);
            make.left.right.mas_equalTo(0);
        }];
        
        
        CGFloat imagesize = self.frame.size.height - 50;
        _menu_image_view = [UIImageView new];
        [self.contentView addSubview:_menu_image_view];
        [_menu_image_view mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(10);
            make.centerX.mas_equalTo(self);
            make.size.mas_equalTo(CGSizeMake(imagesize, imagesize));
        }];
        
    }
    return self;
}

- (void)loadHomeMenuCellData:(HomeMenuModel *)data
{
    _title_label.text = data.menuTitle;
    _menu_image_view.image = [UIImage imageNamed:data.menuImage];
}

@end
